<?php


require_once('../includes/getid3/getid3/getid3.php');
$getID3 = new getID3;


$dir = '/var/music/kscope/';
rename($dir . $_REQUEST['old_filename'], $dir . $_REQUEST['filename']);
echo ('file moved!');

$ThisFileInfo = $getID3->analyze($dir.$_REQUEST['filename']);
getid3_lib::CopyTagsToComments($ThisFileInfo);
$title = (isset($ThisFileInfo['comments_html']['title'][0]) ? $ThisFileInfo['comments_html']['title'][0] : "");
echo ($title);


$files = scandir($dir);
foreach ($files as  $filename) {
	echo($filename . '<br />');
}
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input type="hidden" name="old_filename" value="<?php echo($files[2])?>" />
<input type="text" name="filename" value="<?php echo($files[2])?>" />

<input type="hidden" name="moveFiles" value="true" />
<input type="submit" />
</form>

